﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Categories : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session[EClass.ESession.Admin.ToString()] == null)
        {
            Response.Redirect("Login.aspx", true);
        }
        if(Request.QueryString["action"] == null)
            return;
        if(Request.QueryString["action"] == "insert")
        {
            _grdView.DataSourceID = "";
        }
    }
    protected void _grdView_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if(e.CommandName == "New")
        {
            _grdView.DataSourceID = "";
            _grdView.DataBind();
        }
    }
    protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
    {
        _grdView.DataSourceID = _SDSCategories.ID;
        _grdView.DataBind();
    }
}
